<template>
  <div>
    <el-container>
      <el-aside :width="homedata.leftWidth + 'px'" style="line-height: 60px;border-right: 1px solid gray;text-align: center;">
          <span style="font-size: 40px;" >
            <template v-if="homedata.leftWidth == 200" >
            CHAO
          </template>
          <template v-else>
            <i class="iconfont icon-ku" style="font-size: 40px"></i>
          </template>
          </span>
      </el-aside>
      <el-main>
        <el-row>

          <el-col :span="12">
            <el-menu :default-active="activeIndex" mode="horizontal"
                     @select="selectNav"
                     background-color="#409EFF"
                     text-color="#fff" active-text-color="#F4C66E">

              <el-menu-item index="1">
                <i :class="['iconfont',isShouqi] " style="font-size: 25px;color: white"></i>
              </el-menu-item>
              <el-menu-item index="2">处理中心</el-menu-item>
              <el-menu-item index="3">导航1</el-menu-item>
              <el-menu-item index="4">导航2</el-menu-item>
              <el-menu-item index="5">导航3</el-menu-item>
            </el-menu>
          </el-col>
          <el-col :span="12" style="display: flex;justify-content:flex-end; ">
            <el-menu :default-active="ractiveIndex" mode="horizontal" background-color="#409EFF"
                     text-color="#fff" active-text-color="#F4C66E">
              <el-menu-item index="1">
                <el-badge :value="12" style="line-height: 25px">
                  <i class="iconfont icon-tixing" style="font-size: 30px;color: white"></i>
                </el-badge>
              </el-menu-item>
              <el-menu-item index="2">
                admin
                &nbsp;&nbsp;
                <img src="../assets/logo.png" height="40px" width="40px"
                     style="border-radius: 40px;border: 1px solid white">
              </el-menu-item>
            </el-menu>
          </el-col>
        </el-row>

      </el-main>
    </el-container>
  </div>
</template>

<script>
  export default {
    props: ['homedata'],
    name: "Header",
    data() {
      return {
        activeIndex: "1",
        ractiveIndex: '10',
        isShouqi: 'icon-shouqi'
      }
    },
    methods: {
      selectNav(key, keyPath) {
        if (key == 1) {
          if (this.isShouqi == "icon-shouqi") {
            this.homedata.leftWidth = 80;
            this.homedata.isCollapse = true;
            this.isShouqi = "icon-zhankai";
          } else {
            this.homedata.leftWidth = 200;
            this.homedata.isCollapse = false;
            this.isShouqi = "icon-shouqi";
          }

        }
      }
    }
  }
</script>

<style scoped>
  .el-main {
    padding: 0;
  }
</style>
